#include "stdafx.h"
#include "TestCircularTorus.h"
#include "UECircularTorus.h"
#include "UEEntityOperation.h"

CPPUNIT_TEST_SUITE_REGISTRATION( TestCircularTorus );


TestCircularTorus::TestCircularTorus()
{
}


TestCircularTorus::~TestCircularTorus()
{
}

void TestCircularTorus::testCreate()
{
	AcGePoint3d BaseCenter1;
	AcGePoint3d BaseCenter2;
	AcGeVector3d BaseDir1;
	AcGeVector3d BaseDir2;
	double dRBase;

	BaseCenter1 = AcGePoint3d::kOrigin;
	BaseCenter2.set( 500, 0, 500 );
	BaseDir1.set( 0, 0, -1 );
	BaseDir2 = AcGeVector3d::kXAxis;
	dRBase = 100;
	
	CUECircularTorus* pCircularTorus = new CUECircularTorus( BaseCenter1, BaseCenter2, BaseDir1, 
											BaseDir2, dRBase );

	AcDb3dSolid* pSolid = pCircularTorus->Create();

	Acad::ErrorStatus es = CUEEntityOperation::AddEntityToDwg( pSolid );
	if ( es != Acad::eOk )
	{
		delete pCircularTorus;
		delete pSolid;
	}
	delete pCircularTorus;
	pSolid->close();
}